package com.example.backend.http.server;

import com.example.client.core.ApiInvoker;
import com.example.client.core.ApiProtocol;
import com.example.client.core.ApiService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Peng Yisheng
 * @Date 2024/11/29 14:15
 * @Description http服务
 */
@Slf4j
@RestController
@ApiService(serviceId = "backend-http-server", version = "1.0.0", protocol = ApiProtocol.HTTP, patternPath = "/http/**")
@RequestMapping("/http")
public class PingController {

    @ApiInvoker(path = "/http/ping")
    @GetMapping("/ping")
    public String ping() throws Exception {
        log.info("receive ping");
//        Thread.sleep(100000);
        return "pong";
    }

}
